<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ include file="/WEB-INF/taglib.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <title>行业信息</title>
    <%@ include file="/WEB-INF/jsp/include.jsp" %>
    <script type="text/javascript">
        $(function () {
            setAjaxLoading();
            ajaxJson('${path}/basicinfo/taxPayersInfo/listByPindustryCode', null, initTree);
        });

        //初始化树点击函数
        function zTreeOnClick(event, treeId, treeNode) {
        };

        function dataFilter(treeId, parentNode, responseData) {
            var rows = [];
            if (responseData) {
                if (responseData.code != '0000') {
                    $.messager.alert('操作提示', responseData.msg, 'info', function () {
                    });
                } else {
                    rows = responseData.returnObject;
                }
            }
            return rows;
        };

        function btnOk() {
            var treeObj = $.fn.zTree.getZTreeObj("tree");
            var nodes = treeObj.getSelectedNodes();
            if (nodes != null && nodes.length > 0) {
                var treeNode = nodes[0];
                if (treeNode.level == 4) {
                    //返回选中的行业代码和名称
                    var returnValue = new Object();
                    returnValue.code = treeNode.id;
                    returnValue.name = treeNode.name;
                    parent.window.callback_selectHyxx(returnValue);
                    setTimeout("closeLayer()", 100);
                } else {
                    $.messager.alert('操作提示', '请选择末级明细行业！', 'info', function () {
                    });
                }
            } else {
                $.messager.alert('操作提示', '请选择一个明细行业！', 'info', function () {
                });
            }
        }
    </script>
</head>

<body class="easyui-layout">
<%@ include file="/WEB-INF/jsp/loading.jsp" %>
<div region="center" style="padding: 5px;" border="false">
    <div class="easyui-layout" fit="true" border="false">
        <div region="center" title="主体部分" border="false" noheader="true" style="padding: 0px;">
            <div class="easyui-layout" fit="true" border="false">
                <div data-options="region:'center',title:'',split:false,border: false">
                    <div>
                        <ul id="tree" class="ztree" style="width: 90%; height: 90%;"></ul>
                    </div>
                </div>
                <div data-options="region:'south',title:'',split:false,border: false" style="width:100px;">
                    <div align="center" style="margin-top: 15px;">
                        <a id="btn_ok_d" href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-ok"
                           onclick="btnOk()">确定</a>
                        <a id="btn_close_d" href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel"
                           onclick="closeLayer();">关闭</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
